﻿using Domain.Entity;
using Domain.Repository;
using EFCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Application.StudentService
{
    public class StudentAppService : IStudentAppService
    {
        private readonly IStudentRepository studentRepository;
        public StudentAppService(IStudentRepository studentRepository)
        {
            this.studentRepository = studentRepository;
        }
        public Task<int> StudentAddAsync(Student student)
        {
            return studentRepository.AddStudentAsync(student);
        }
        //删除
        public Task<int> StudentDeleteAsync(int Id)
        {
            return studentRepository.DeleteStudentAsync(Id);
        }

        //修改
        public Task<int> StudentUpdateAsync(Student student)
        {
            return studentRepository.UpdateStudentAsync(student);
        }
        //查询
        public List<Student> StudentSelectAsync()
        {
            return studentRepository.SelectStudentsAsync();
        }
    }
}
